import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'

// https://vitejs.dev/config/
export default () => {
  return defineConfig({
    root: '.',
    base: '',
    plugins: [reactRefresh()],
    server: {
      port: 83,
      host: '0.0.0.0',
      proxy: {
        '/sw': {
          target: 'https://s.youdianstar.com/',
          // target: 'https://dev.youdianzhixing.com',
          changeOrigin: true,
          secure: false,
          // rewrite: (path) => path.replace(/^\/app/, ''),
          // 修改Cookie路径，让浏览器能正确发送Cookie

        },
      },
    },
  })
}
